using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for FaultDelivery
/// </summary>
public class FaultDelivery : IBusinessEntity
{
    private int _deliverableID;
    private string _faultDate;
    private string _reason;
    private decimal _refundAmount;
    private bool _isRepaid;

    public FaultDelivery()
    {
    }

    public int DeliverableID
    {
        get { return _deliverableID; }
        set { _deliverableID = value; }
    }

    public string FaultDate
    {
        get { return _faultDate; }
        set { _faultDate = value; }
    }
    
    public string Reason
    {
        get { return _reason; }
        set { _reason = value; }
    }

    public decimal RefundAmount
    {
        get { return _refundAmount; }
        set { _refundAmount = value; }
    }

    public bool IsRepaid
    {
        get { return _isRepaid; }
        set { _isRepaid = value; }
    }

    #region IBusinessEntity Members

    public void Fill(System.Data.SqlClient.SqlDataReader reader)
    {
        _deliverableID = reader.GetInt32(0);
        _faultDate = reader.GetDateTime(1).ToString("dd/MM/yyyy");
        _reason = reader.GetString(2);
        _refundAmount = reader.GetDecimal(3);
        _isRepaid = reader.GetBoolean(4);
    }

    #endregion
}
